package p.ithorns.framework.redis.stream.listener;


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import p.ithorns.framework.redis.stream.RedisStreamListener;
import p.ithorns.framework.redis.stream.RedisStreamTemplate;

/**
 * StringMessageListener
 *
 * @author ithorns
 * @version 1.0.0
 * @date 2022/12/10 13:23
 */
//@Component
public class StringMessageListener extends RedisStreamListener<String> {

    private final static Logger log = LoggerFactory.getLogger(StringMessageListener.class);

    public StringMessageListener(RedisStreamTemplate template) {
        super(template);
    }

    @Override
    public void onMessage(String value) {
        log.info("{} ==> {}", getGroup(), value);
    }

    @Override
    public String getStream() {
        return "stream1";
    }

    @Override
    public String getGroup() {
        return "group1";
    }

    @Override
    public String getGroupName() {
        return "消费组2";
    }

}